#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy.linalg import solve
from scipy.optimize import fsolve


#方法1
A = np.array([[3,4,2],[5,3,4],[8,2,7]])
b = np.array([10,14,20])

x,y,z = np.dot(np.linalg.inv(A),b) 

#方法2
x1,y1,z1 = solve(A,b)

#方法3
def func(paramlist):
    x,y,z = paramlist[0],paramlist[1],paramlist[2]
    return [3*x+4*y+2*z-10, 5*x+3*y+4*z-14, 8*x+2*y+7*z-20]

x2,y2,z2 = fsolve(func,[0,0,0])